const Koa = require('koa')
// const { normal } = require('./tpl')
// import {normal} from './tpl'
// import pug from 'pug'
import views  from 'koa-views'
import {resolve} from 'path'
const app = new Koa()
app.use(views(resolve(__dirname, './views'),  {
    extension: 'pug'//以pug未后缀名的文件
}))
app.use(async (cxt, next) => {
    await cxt.render('index', {
        you:'luke',
        me:'zhag'
    })
    // cxt.type = 'text/html;charest=utf-8'
    // cxt.body = pug.render(normal, {
    //     you:'luke',
    //     me:'zhang'
    // })
})
app.listen(4000)